<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;

/**
 * Bank控制器
 */
class Bank extends AdminBase
{
    
    /**
     * Bank列表
     */
    public function BankList()
    {
        
        $where = $this->logicBank->getWhere($this->param);
        
        $this->assign('list', $this->logicBank->getBankList($where, 'a.*', 'a.sort desc'));
        
        return $this->fetch('Bank_list');
    }
    
    /**
     * Bank添加
     */
    public function BankAdd()
    {
        
        $this->BankCommon();
        
        return $this->fetch('Bank_edit');
    }
    
    /**
     * Bank编辑
     */
    public function BankEdit()
    {
        
        $this->BankCommon();

        $info = $this->logicBank->getBankInfo(['a.id' => $this->param['id']], 'a.*');

        
        $this->assign('info', $info);
        
        return $this->fetch('Bank_edit');
    }
    
    /**
     * Bank添加与编辑通用方法
     */
    public function BankCommon()
    {
        
        IS_POST && $this->jump($this->logicBank->BankEdit($_POST));
        

    }



    

    /**
     * 数据状态设置
     */
    public function setStatus()
    {
        
        $this->jump($this->logicAdminBase->setStatus('Bank', $this->param));
    }
    /**
     * 排序
     */
    public function setSort()
    {

        $this->jump($this->logicAdminBase->setSort('Bank', $this->param));
    }
}
